<?php    
header("Expires: Mon, 26 Jul 1970 05:00:00 GMT");      
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");      
header("Cache-Control: no-cache, must-revalidate");      
header("Pragma: no-cache");    
?> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="60" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script language="javascript"> 
$(document).ready(function(){
	  $(".jobId").mouseover(function(){
		  var currentId = $(this).attr('id');
	      $("#text" + currentId).css("display","block");
	  });
	  $(".jobId").mouseout(function(){
		  $(".test").css("display","none");
	  });
	  $(".status").mouseover(function(){
		  var currentId = $(this).attr('id');
	      $("#status" + currentId).css("display","block");
	  });
	  $(".status").mouseout(function(){
		  $(".test").css("display","none");
	  });
	});

</script>
<title>Upate News</title>
<style type="text/css">
.title{ color:#018; font-weight:bold;}
.today{ color:#F60; font-weight:bold; text-decoration:none;}
.notoday{ color:#666; text-decoration:none;}

.test{
 	position:fixed;
	left:120px;
	top:50px;
	background:yellow;
	z-index:1;
	display:none;
	font-size:10px;
}

.table{
	font-size:11px;
}
* html .test{ width:190px; top:expression(eval(document.body.scrollTop)); background:yellow;}
</style>

</head>
<?php 
$dateToday = Model_DatetimeHelper::dateToday();
$rJob = new Model_DbTable_Repairjob();
?>
<body style="font-family:Arial, Helvetica, sans-serif; font-size:13px; line-height:18px; margin-top:0; margin-left:0;">
 Your Shop Password<br/>
<strong> [ <?=$this->shoppassword?> ]</strong><br/>
<span class="title">Emergency Job List:</span> <br />
<?php if(!empty($this->jobList)){?>

<table border = "1" class = "table" cellspacing="0" cellpadding="2">
	<tr>
		<th>Job Id</th>
		<th>Status</th>
		<th>Left Days</th>
	</tr>
	<?php if($this->shop == 'COPC'){?>
	<?php foreach($this->jobList as $k => $v){?>
	<tr>
			<td><a class = "jobId" id = "<?php echo $v['job_id'];?>" href = "/repaircenter/viewdetailstatus/jobid/<?php echo $v['job_id'];?>" target="_blank"><?php echo $v['job_id'];?></a>
			<div id = "text<?php echo $v['job_id'];?>" class = "test">
				<table border="1" cellspacing="0" cellpadding="2" style="TABLE-LAYOUT: fixed" width = "200">
					<?php $jobDetail = $rJob->getJob($v['job_id']);?>
					<tr>
						<th>Shop</th>
						<th>Model/Color</th>
						<th>Start Date</th>
					</tr>
					<tr>
						<td><?php echo $jobDetail['shop_code']?></td>
						<td><?php echo $jobDetail['mobile_model']?>/<?php echo $jobDetail['mobile_color']?></td>
						<td><?php echo $jobDetail['date_start']?></td>
					</tr>
				</table>
			</div>
			
			</td>
			<td><a class = "status" id = "<?php echo $v['job_id'];?>" href = "/repaircenter/changestatus/jobid/<?php echo $v['job_id'];?>" target="_blank">
				<?php if($v['status'] <= 10){
					echo "In transfer to HQ";
 				}elseif($v['status'] > 10 && $v['status'] <= 24 && $v['status'] != 23){
					echo "Repair in process";
				}elseif($v['status'] > 24 && $v['status'] <= 27){
					echo "In transfer to Shop";
				}else{
					echo $v['des'];
				}?>
				</a>
			<div id = "status<?php echo $v['job_id'];?>" class = "test">
				<table border="1" cellspacing="0" cellpadding="2" style="TABLE-LAYOUT: fixed" width = "200">
					
					<tr>
						<th>Status</th>
					</tr>
					<tr>
						<td><?php echo $v['des'];?></td>
					</tr>
				</table>
			</div>
			
			
			</td>
			<?php if($v['left_days'] <0){?>
				<td><?php echo "Over ".(0-$v['left_days']);?></td>
			<?php }else{?>
				<td><?php echo $v['left_days'];?></td>
			<?php }?>
	</tr>		
	<?php }?>
	

<?php }else{ ?>

	<?php foreach($this->jobList as $k => $v){?>
	<tr>
			<td><?php echo $v['job_id'];?></td>
			<td><?php echo $v['des'];?></td>
			<?php if($v['left_days'] <0){?>
				<td><?php echo "Over ".(0-$v['left_days']);?></td>
			<?php }else{?>
				<td><?php echo $v['left_days'];?></td>
			<?php }?>

	</tr>		
	<?php }?>
	

<?php }?>	
<?php }else{
		echo "No Emergency Job"?>
		
<?php }?>
</table>

</body>
</html>
